This replication package contains data from public sources, Stata code (run on Stata 17), and Python code (run on Python3.12.1). Most of the code is in Stata, but there are a couple of python sub-routines. In these cases the Stata code calls the Python code and data is passed back and forth between Stata and Python using temporary .csv files. 

The files are organized into folders:
Python
Raw Data
Stata
	Data
	Latex
	Maps
tempdir
transfer

Python contains the python code. Raw Data contains data from public sources (EPA CEMS, EIA, etc).  Stata contains the Stata code and three sub-folders. The subfolder Data contains the Stata data files (.dta files). Most of the Stata data files are created by the Stata code using raw data but some (such as CEMS data) have been cleaned from raw data in previous work. The subfolder Latex  contains figures and tables that are used by Latex to typeset the paper. These figures and tables are outputs from the Stata code.  The subfolder Maps contains GIS data for making US county maps and maps of the electricity regions. The tempdir folder is used to store temporary Stata data files that are used for intermediate computations. The transfer folder is used to transfer data between Stata and Python.

The Stata folder has filenames with numerical prefixes. The code should be run in the order of these prefixes. The visual representation of the files names resembles a BASIC program. For example, the first three files in the Stata folder are

00 globals.do
10 plant coal type.do
30 create CEMS_unit_characteristics_2019.do

Thus to replicate the results, you first run "00 globals.do". Then "10 plant coal type.do", and so on.  Note you must re-run the "00 globals.do" if you exit from Stata for some reason and then return to run more files.  The files have a commented out reminder
to run the "00 globals.do" program first. 

Some files run fairly quickly. Others take a while. Here are time estimates for files that are not quick.
90 create scenarios v3.do.  (about 3 hours)
120 scenarios by coal mc order v6.do (about 2 hours)
140 scenarios by carbon tax coal v3.do (about 10 days)
145 scenarios by pigou tax.do (about 12 hours)
210 scenarios by coal mc order Gas constraint v4.do (about 1/2 hour)

